let aa;
let bb;
let cc;
let dd;
let ee;
// 判定用户名的长度
username.addEventListener("keyup", function () {
    let a = document.getElementById("username")
    if (a.value.length > 20 || a.value.length < 6) {
        tips_0.style.display = "block"
        aa = 0
    } else {
        tips_0.style.display = "none"
        aa = 1
        gg()
    }
    return aa
})
// 判定手机号码的长度
psw.addEventListener("keyup", function () {
    let b = document.getElementById("psw")
    if (b.value.length != 11) {
        tips_1.style.display = "block"
        bb = 0
    } else {
        tips_1.style.display = "none"
        bb = 1
        gg()
    }
    return bb
})
// 判定验证码的长度
phoner_number.addEventListener("keyup", function () {
    let c = document.getElementById("phoner_number")
    if (c.value.length != 6) {
        tips_2.style.display = "block"
        cc = 0
    } else {
        tips_2.style.display = "none"
        cc = 1
        gg()
    }
    return cc
})
// 判定密码的长度
validating_code.addEventListener("keyup", function () {
    let d = document.getElementById("validating_code")
    if (d.value.length > 12 || d.value.length < 6) {
        tips_3.style.display = "block"
        dd = 0
    } else {
        tips_3.style.display = "none"
        dd = 1
        gg()
    }
    return dd
})
ok.addEventListener("change", function () {


    if (ok.checked === true) {
        ee = 1;
    } else {
        ee = 0
        gg()
    }
    return ee
})

function gg() {

    let rr = document.querySelectorAll("input")
    rr.forEach(v => {
        v.addEventListener("keyup,key", function () {
            if (aa === 1 && bb === 1 && cc === 1 && dd === 1 && dd === 1 && ee === 1) {
                btn.removeAttribute("disabled")
                btn.classList.add("okk")
            } else {
                btn.setAttribute("disabled", "disabled")
                btn.classList.remove("okk")
            }
        })
    })
}
// btn.removeAttribute("disabled")
// console.log(ok.checked)
xxx.addEventListener("click", function () {
    console.log(ee)
})